package com.pingba.service.msg;

import com.pingba.entity.User;
import com.pingba.entity.msg.MsgSend;
import com.pingba.entity.msg.MsgSubscribe;
import com.pingba.service.BaseService;

import java.util.List;

/**
 * Created by Administrator on 2015/11/28 0028.
 */
public interface MsgSubscribeService extends BaseService<MsgSubscribe, Long> {

    /**
     * 获取该用户的收藏的消息
     * @param user
     * @return
     */
    List<MsgSend> mySubscribes(User user);

    void setDeleted(MsgSubscribe subscribe);

    /**
     * 收藏
     * @param subscribe
     * @deprecated
     */
    void subscribeOne(MsgSubscribe subscribe);

    /**
     * 增加收藏，动态的拼装subscribe对象
     * @param userId
     * @param msgSendId
     */
    void subscribeOne(long userId, long msgSendId);

    /**
     * 用户取消对消息的收藏
     * @param userId
     * @param msgSendId
     */
    void unSubscribeOne(long userId, long msgSendId);

    /**
     * 查看用户是否收藏过该条消息
     * @param userId
     * @param msgSendId
     * @return
     */
    boolean isSubsribed(long userId, long msgSendId);

    /**
     * 删除MsgSend时同时删除MsgSubscribe
     * @param msgSendId
     */
    void deleteSubscribeOfSend(long msgSendId);
}
